package com.yupi.springbootinit.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.springbootinit.model.dto.operation.OperationQueryRequest;
import com.yupi.springbootinit.model.entity.Operation;
import com.yupi.springbootinit.model.vo.OperationVO;

/**
 * 工序库服务
 */
public interface OperationService extends IService<Operation> {

    /**
     * 校验工序库信息
     *
     * @param operation 工序库实体
     * @param add       是否为创建校验
     */
    void validOperation(Operation operation, boolean add);

    /**
     * 获取查询条件
     *
     * @param operationQueryRequest 查询请求
     * @return 查询条件
     */
    QueryWrapper<Operation> getQueryWrapper(OperationQueryRequest operationQueryRequest);

    /**
     * 获取工序库封装
     *
     * @param operation 工序库实体
     * @return 工序库VO
     */
    OperationVO getOperationVO(Operation operation);

    /**
     * 分页获取工序库封装
     *
     * @param operationPage 工序库分页
     * @return 工序库VO分页
     */
    Page<OperationVO> getOperationVOPage(Page<Operation> operationPage);
}